 /*
	CJAX FRAMEWORK @version@
	ajax made easy with cjax
	
	-- DO NOT REMOVE THIS -- 
	-- AUTHOR COPYRIGHT MUST REMAIN INTACT --
	CJAX FRAMEWORK
	Written by: Carlos Galindo
	Website: @website@
	Email: cjxxi@msn.com
	Date: @date@
	Last Updated: @lastupdate@
*/
var plugins = new plugins();

function plugins() {
	this.plugins = [];
	this.params = [];
	this.dir;
	this.hook		=		function(buffer) {
		var f = buffer.f('method');
		var route = buffer.xml('route')? f+'/':'';
		var ext = buffer.xml('ext')? buffer.xml('ext'):'.js';
		var base = buffer.vars('base')+'/plugins/'+route+f+ext;
		var s = buffer.xml('seconds');
	
		//var params = '<params>'+buffer.array('param')+'</params>';
		
		var params = buffer.xml('params');
		//params = params.append('ctype','extension_child');
		this.dir = CJAX.get.dirname(base,2);
		if(route) {
			this.dir += '/'+f
		}
		if(!base.loaded()){
			try {
				plugins[f] = CJAX.script.load(base,f,params);
			}
			catch(e){ alert('Plugin: unabled to load function: '+ f + '() '+e); }
		} else {
			CJAX.load.action(f,params,s);
		}
	}
	
}